{% extends 'base.html' %}
{% load pagination_tags %}
{% load mytags %}
{% block content %}
<!--热门主题-->
        <div class="row">
        {% autopaginate blog %}
        {% for obj in blog %}
        <div class="media">
          <div class="media-body">
             <div class="thumbnail">
              <div class="caption">
          <a class="pull-left" href="/blog/{{ obj.id }}/">
            <img class="media-object img-circle" src="{{ obj.img }}" width="32" height="32">
          </a>
                <p><!--标题.类别-->
                    <strong>
                        <a href="/blog/{{ obj.id }}/">{{ obj.title }}</a>
                        <a href="/blog/type/{{ obj.type }}/" class="label label-warning navbar-text navbar-right">{{ obj.getType.name }}</a>
                    </strong>
                </p>
                <small>{% if obj.is_show %}密文:需要密码才能访问{% else %}{{ obj.summary|cut_title:'200' }}{% endif %}</small>
                <p class="small_hr">
                    作者：<a href="/" class="small">坤子</a>
                    &nbsp;&nbsp;&nbsp;&nbsp;热度：{{ obj.counts }}℃
                    {% if obj.getTags %}&nbsp;&nbsp;&nbsp;&nbsp;标签：{% for i in obj.getTags %}<a href="/blog/tag/{{ i.tag.id }}/" class="label label-danger">{{ i.tag.name }}</a> &nbsp;{% endfor %}{% endif %}
                    {% if user.is_active %}
                        &nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" class="text-info" onclick="delBlog({{ obj.id }})">删除</a>
                        &nbsp;&nbsp;&nbsp;&nbsp;<a href="/manage/add/?id={{ obj.id }}" class="text-danger" id="edit_">编辑</a>
                    {% endif %}
                </p>
              </div>
            </div>
          </div>
        </div>
        {% endfor %}
        </div>
    <div class="text-center text-danger">{% paginate %}</div>

    {% endblock %}


